package com.example.demo.controller;

import com.example.demo.design.StrategyContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.math.BigDecimal;


@RequestMapping
@Controller
public class HelloController {
    @Autowired
    private StrategyContext strategyContext;

    @RequestMapping("/calculatePrice")
    public @ResponseBody
    BigDecimal calculatePrice(String memberLevel) {
        return strategyContext.calculatePrice(memberLevel);
    }

}
